<template>
  <div>
    <el-tree
        :data="data"
        show-checkbox
        node-key="id"
        :props="defaultProps"
        @check-change='getids'
    />


  </div>
</template>

<script>
import myaxios from "@/http/axios";

export default {
  name: "deptree",
  data() {
    return {
      data1: '',
      data:[],
      defaultProps: {
        children: 'children',
        label: 'name',
      },
    }
  },
  methods: {
    getids(data){
      // let list=[]
      if (data.type==3){
        this.checkdvalues.push(data.id)
      }
      console.log(this.list)
    },
    getaudit(){
      //读取公司部门角色列表
      myaxios('getcomanyuser','get').then(res=>{
        this.data = res.list
      })
      this.dialogTableVisible=true
    },
  },
  mounted() {
    this.getaudit()
  }
}
</script>

<style scoped>

</style>